package com.ace3l.legal.backend.exceptions;

import java.text.MessageFormat;
import java.io.Serializable;

/**
 * Created by IntelliJ IDEA.
 * User: ageer
 * Date: Aug 18, 2008
 * Time: 8:16:00 PM
 * To change this template use File | Settings | File Templates.
 */
public class ProjectException extends Exception implements Serializable {
    Ace3LError errorType;
    String projectId;

    public ProjectException(Ace3LError errorType, String projectId) {
        this.errorType = errorType;
        this.projectId = projectId;
    }

    public ProjectException() {
        this(Ace3LError.UNKNOWN_ERROR, "-1");
    }

    public String getLocalizedMessage() {
        return errorType.renderMessage(new Object[] {projectId});
    }

    public String getMessage() {
        return errorType.renderMessage(new Object[] {projectId});
    }
}
